<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/1/17
  Time: 12:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>行政管理</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <script src="${pageContext.request.contextPath}/layui/layui.js"></script>
    <script>
        //一般直接写在一个js文件中
        layui.use(['layer', 'form','element'], function(){
            var layer = layui.layer
            var form = layui.form;

            //  layer.msg('Hello World');

            var names= new Array("会议室管理","用车管理","用章管理","图书借阅申请","名片印刷流程")

            var jsp=['/jsp/meeting.jsp','/jsp/car.jsp','/jsp/seal.jsp','/jsp/book.jsp','/jsp/card.jsp'];
            for (var i=0;i<names.length;i++){
                addTab(i,names[i],jsp[i])
            }





        });

        function addTab(id,name,url) {
            var $= layui.jquery
            var element = layui.element;
            //alert(000)
            if ($("li[lay-id='"+id+"']").length==0){
                element.tabAdd('demo', {
                    title: name
                    ,content: '<iframe src='+url+' frameborder="0" id="demoAdmin" style="width: 100%; height: 500px;"></iframe>' //支持传入html
                    ,id: id
                });
            }
            element.tabChange("demo", id);
        }

    </script>


</head>
<body>



<div class="layui-tab" lay-filter="demo" >
    <ul class="layui-tab-title">
        <%--<li class="layui-this">欢迎页</li>--%>
    </ul>
    <div class="layui-tab-content">
        <%--<div class="layui-tab-item layui-show">欢迎登录</div>--%>
    </div>
</div>

</body>
</html>
